// ****************************************************************************** 
// Copyright     :  Copyright (C) 2018, Hisilicon Technologies Co. Ltd.
// File name     :  general_wdog_c_union_define.h
// Project line  :  Platform And Key Technologies Development
// Department    :  ICT
// Author        :  Huawei
// Version       :  1.0
// Date          :  2016/6/30
// Description   :  
// Others        :  Generated automatically by nManager V4.2 
// History       :  Huawei 2018/04/10 11:55:03 Create file
// ******************************************************************************

#ifndef __GENERAL_WDOG_C_UNION_DEFINE_H__
#define __GENERAL_WDOG_C_UNION_DEFINE_H__

/* Define the union U_WCS */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_0      : 29  ; /* [31:3] */
        unsigned int    ws1_status : 1  ; /* [2] */
        unsigned int    ws0_status : 1  ; /* [1] */
        unsigned int    enable     : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WCS;

/* Define the union U_WOR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    offset_value : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WOR;

/* Define the union U_WCV_L */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_comp_value_l : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WCV_L;

/* Define the union U_WCV_H */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_comp_value_h : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WCV_H;

/* Define the union U_W_IIDR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    productid            : 12  ; /* [31:20] */
        unsigned int    architecture_version : 4  ; /* [19:16] */
        unsigned int    revision             : 4  ; /* [15:12] */
        unsigned int    implementer_ccode    : 4  ; /* [11:8] */
        unsigned int    rsv_1                : 1  ; /* [7] */
        unsigned int    implementer_icode    : 7  ; /* [6:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_W_IIDR;

/* Define the union U_WDOG_PCELL_ID0 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_pcell_id0 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PCELL_ID0;

/* Define the union U_WDOG_PCELL_ID1 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_pcell_id1 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PCELL_ID1;

/* Define the union U_WDOG_PCELL_ID2 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_pcell_id2 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PCELL_ID2;

/* Define the union U_WDOG_PCELL_ID3 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_pcell_id3 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PCELL_ID3;

/* Define the union U_WDOG_PERIPH_ID0 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_periph_id0 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PERIPH_ID0;

/* Define the union U_WDOG_PERIPH_ID1 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_periph_id1 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PERIPH_ID1;

/* Define the union U_WDOG_PERIPH_ID2 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_periph_id2 : 24  ; /* [31:8] */
        unsigned int    archrev         : 4  ; /* [7:4] */
        unsigned int    rsv_2           : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PERIPH_ID2;

/* Define the union U_WDOG_PERIPH_ID3 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_periph_id3 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PERIPH_ID3;

/* Define the union U_WRR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    refresh_en : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WRR;

/* Define the union U_W_IIDR_SF */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    productid_sf            : 12  ; /* [31:20] */
        unsigned int    architecture_version_sf : 4  ; /* [19:16] */
        unsigned int    revision_sf             : 4  ; /* [15:12] */
        unsigned int    implementer_ccode_sf    : 4  ; /* [11:8] */
        unsigned int    rsv_3                   : 1  ; /* [7] */
        unsigned int    implementer_icode_sf    : 7  ; /* [6:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_W_IIDR_SF;

/* Define the union U_WDOG_PCELL_ID0_SF */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_pcell_id0_sf : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PCELL_ID0_SF;

/* Define the union U_WDOG_PCELL_ID1_SF */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_pcell_id1_sf : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PCELL_ID1_SF;

/* Define the union U_WDOG_PCELL_ID2_SF */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_pcell_id2_sf : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PCELL_ID2_SF;

/* Define the union U_WDOG_PCELL_ID3_SF */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_pcell_id3_sf : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PCELL_ID3_SF;

/* Define the union U_WDOG_PERIPH_ID0_SF */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_periph_id0_sf : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PERIPH_ID0_SF;

/* Define the union U_WDOG_PERIPH_ID1_SF */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_periph_id1_sf : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PERIPH_ID1_SF;

/* Define the union U_WDOG_PERIPH_ID2_SF */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_periph_id2_sf : 24  ; /* [31:8] */
        unsigned int    archrev_sf         : 4  ; /* [7:4] */
        unsigned int    rsv_4              : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PERIPH_ID2_SF;

/* Define the union U_WDOG_PERIPH_ID3_SF */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wdog_periph_id3_sf : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_WDOG_PERIPH_ID3_SF;


//==============================================================================
/* Define the global struct */
typedef struct
{
    volatile U_WCS                WCS                ; /* 0 */
    volatile U_WOR                WOR                ; /* 8 */
    volatile U_WCV_L              WCV_L              ; /* 10 */
    volatile U_WCV_H              WCV_H              ; /* 14 */
    volatile U_W_IIDR             W_IIDR             ; /* FCC */
    volatile U_WDOG_PCELL_ID0     WDOG_PCELL_ID0     ; /* FD0 */
    volatile U_WDOG_PCELL_ID1     WDOG_PCELL_ID1     ; /* FD4 */
    volatile U_WDOG_PCELL_ID2     WDOG_PCELL_ID2     ; /* FD8 */
    volatile U_WDOG_PCELL_ID3     WDOG_PCELL_ID3     ; /* FDC */
    volatile U_WDOG_PERIPH_ID0    WDOG_PERIPH_ID0    ; /* FE0 */
    volatile U_WDOG_PERIPH_ID1    WDOG_PERIPH_ID1    ; /* FE4 */
    volatile U_WDOG_PERIPH_ID2    WDOG_PERIPH_ID2    ; /* FE8 */
    volatile U_WDOG_PERIPH_ID3    WDOG_PERIPH_ID3    ; /* FEC */
    volatile U_WRR                WRR                ; /* 10000 */
    volatile U_W_IIDR_SF          W_IIDR_SF          ; /* 10FCC */
    volatile U_WDOG_PCELL_ID0_SF  WDOG_PCELL_ID0_SF  ; /* 10FD0 */
    volatile U_WDOG_PCELL_ID1_SF  WDOG_PCELL_ID1_SF  ; /* 10FD4 */
    volatile U_WDOG_PCELL_ID2_SF  WDOG_PCELL_ID2_SF  ; /* 10FD8 */
    volatile U_WDOG_PCELL_ID3_SF  WDOG_PCELL_ID3_SF  ; /* 10FDC */
    volatile U_WDOG_PERIPH_ID0_SF WDOG_PERIPH_ID0_SF ; /* 10FE0 */
    volatile U_WDOG_PERIPH_ID1_SF WDOG_PERIPH_ID1_SF ; /* 10FE4 */
    volatile U_WDOG_PERIPH_ID2_SF WDOG_PERIPH_ID2_SF ; /* 10FE8 */
    volatile U_WDOG_PERIPH_ID3_SF WDOG_PERIPH_ID3_SF ; /* 10FEC */

} S_general_wdog_REGS_TYPE;

/* Declare the struct pointor of the module general_wdog */
extern volatile S_general_wdog_REGS_TYPE *gopgeneral_wdogAllReg;

/* Declare the functions that set the member value */
int iSetWCS_ws1_status(unsigned int uws1_status);
int iSetWCS_ws0_status(unsigned int uws0_status);
int iSetWCS_enable(unsigned int uenable);
int iSetWOR_offset_value(unsigned int uoffset_value);
int iSetWCV_L_wdog_comp_value_l(unsigned int uwdog_comp_value_l);
int iSetWCV_H_wdog_comp_value_h(unsigned int uwdog_comp_value_h);
int iSetW_IIDR_productid(unsigned int uproductid);
int iSetW_IIDR_architecture_version(unsigned int uarchitecture_version);
int iSetW_IIDR_revision(unsigned int urevision);
int iSetW_IIDR_implementer_ccode(unsigned int uimplementer_ccode);
int iSetW_IIDR_implementer_icode(unsigned int uimplementer_icode);
int iSetWDOG_PCELL_ID0_wdog_pcell_id0(unsigned int uwdog_pcell_id0);
int iSetWDOG_PCELL_ID1_wdog_pcell_id1(unsigned int uwdog_pcell_id1);
int iSetWDOG_PCELL_ID2_wdog_pcell_id2(unsigned int uwdog_pcell_id2);
int iSetWDOG_PCELL_ID3_wdog_pcell_id3(unsigned int uwdog_pcell_id3);
int iSetWDOG_PERIPH_ID0_wdog_periph_id0(unsigned int uwdog_periph_id0);
int iSetWDOG_PERIPH_ID1_wdog_periph_id1(unsigned int uwdog_periph_id1);
int iSetWDOG_PERIPH_ID2_wdog_periph_id2(unsigned int uwdog_periph_id2);
int iSetWDOG_PERIPH_ID2_archrev(unsigned int uarchrev);
int iSetWDOG_PERIPH_ID3_wdog_periph_id3(unsigned int uwdog_periph_id3);
int iSetWRR_refresh_en(unsigned int urefresh_en);
int iSetW_IIDR_SF_productid_sf(unsigned int uproductid_sf);
int iSetW_IIDR_SF_architecture_version_sf(unsigned int uarchitecture_version_sf);
int iSetW_IIDR_SF_revision_sf(unsigned int urevision_sf);
int iSetW_IIDR_SF_implementer_ccode_sf(unsigned int uimplementer_ccode_sf);
int iSetW_IIDR_SF_implementer_icode_sf(unsigned int uimplementer_icode_sf);
int iSetWDOG_PCELL_ID0_SF_wdog_pcell_id0_sf(unsigned int uwdog_pcell_id0_sf);
int iSetWDOG_PCELL_ID1_SF_wdog_pcell_id1_sf(unsigned int uwdog_pcell_id1_sf);
int iSetWDOG_PCELL_ID2_SF_wdog_pcell_id2_sf(unsigned int uwdog_pcell_id2_sf);
int iSetWDOG_PCELL_ID3_SF_wdog_pcell_id3_sf(unsigned int uwdog_pcell_id3_sf);
int iSetWDOG_PERIPH_ID0_SF_wdog_periph_id0_sf(unsigned int uwdog_periph_id0_sf);
int iSetWDOG_PERIPH_ID1_SF_wdog_periph_id1_sf(unsigned int uwdog_periph_id1_sf);
int iSetWDOG_PERIPH_ID2_SF_wdog_periph_id2_sf(unsigned int uwdog_periph_id2_sf);
int iSetWDOG_PERIPH_ID2_SF_archrev_sf(unsigned int uarchrev_sf);
int iSetWDOG_PERIPH_ID3_SF_wdog_periph_id3_sf(unsigned int uwdog_periph_id3_sf);

#endif // __GENERAL_WDOG_C_UNION_DEFINE_H__
